 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php

require_once "include/function.php";
connect_db();
class wish{
	public function setuserid($userid){
	$this->userid=$userid;
	}	
	
	public function showwishcommon()
	{
		/*$sql_str = "select * 
		from 
			(wishlist wl
				LEFT JOIN wishlist_set wls ON wl.w_set_id = wls.w_set_id)
			,venders v ,
			(((product p
				LEFT JOIN product_rate pr ON p.p_id = pr.p_id)
			LEFT JOIN
				product_file pf ON p.p_id = pf.p_id)
			LEFT JOIN
				categories_sub cs ON p.cat_id = cs.cat_id)
			
		where 
			wl.u_id='".$this->userid."' and wl.p_id=p.p_id and v.v_id=p.v_id;";
			*/
		$sql_str=	"SELECT * FROM wishlist w ,product p,users u,wishlist_set ws WHERE p.p_id = w.p_id and u.u_id=w.u_id and w.w_set_id =ws.w_set_id and p_status=1 order by w_id";
		$irow=0;
		$result = mysql_query($sql_str);
		echo "<table border='2'>";
		while($row = mysql_fetch_array($result))
		{
			$irow++;
			echo "<tr><td>" . $irow . "</td><td>ชื่อ</td><td>".$row["p_name"]."</td>";
			echo "<td>ราคา</td><td>".$row["p_price"]."</td>";
			echo "<td>ชนิด</td><td>".$row["w_set_name"]."</td>";
			echo "<td>รูป</td><td>".$row["title"]."</td>";
			echo "</tr>";
			//echo "<tr><td>download</td><td><a href='book/".$row["bookid"].".pdf'>download</a></td></tr></table><br><br><br>";
			
		}
		echo "</table><br><br><br>";
		//echo "<form action='showall.php' method='post'  >";
			//echo "<input name='showall' type='button'>";
			//echo "</form>";
	}
/*
public function show()
	{	
	while($row = mysql_fetch_array($result))
	{
?>
  <tr>
    <td><?php echo $row["cus_id"];?></td>
    <td><?php echo $row["firstname"];?></td>
    <td><?php echo $row["surname"];?></td>
    <td><?php echo $row["address"];?></td> 
    <td><?php echo $row["username"];?></td>
    <td><?php echo $row["password"];?></td> 

	<td>
    <form method="post" action="RegisterAction.php" >
    <input type="hidden" name="hidden" id="hiddenField" 
    value="<?php echo $row['cus_id'];?>">
    <input name="Delete" type="submit" value="Delete">
    
    </form>
    </td>
  </tr>
  
<?php
	}
	}//end show
*/
}//end class
?>